import request from '@/utils/request'

// 查询物品列表
export function listGoods(query) {
    return request({
        url: '/md/goods/list',
        method: 'get',
        params: query
    })
}

// 查询物品多属性数据
export function listGoodsLines(query) {
    return request({
        url: '/md/goods/listGoodsLines',
        method: 'get',
        params: query
    })
}


// 查询物品详细
export function getGoods(parentCode) {
    return request({
        url: '/md/goods/' + parentCode,
        method: 'get'
    })
}

// 新增物品
export function addGoods(data) {
    return request({
        url: '/md/goods',
        method: 'post',
        data: data
    })
}

// 修改物品
export function updateGoods(data) {
    return request({
        url: '/md/goods',
        method: 'put',
        data: data
    })
}

// 删除物品
export function delGoods(parentCode) {
    return request({
        url: '/md/goods/' + parentCode,
        method: 'delete'
    })
}

// 根据code删除物品多属性数据
export function delLine(code) {
    return request({
        url: '/md/goods/delLine',
        method: 'delete',
        data: code
    })
}

// 保存物品多属性的数据
export function saveMdGoodsLines(data) {
    return request({
        url: '/md/goods/saveMdGoodsLines',
        method: 'post',
        data: data
    })
}